import { axios } from '@/utils/request'

/**
 * 分页查询客户端角色信息列表
 * @param query
 * @returns {AxiosPromise}
 */
export function pageClientRole(query) {
  return axios({
    url: '/clientRole/page',
    method: 'get',
    params: query
  })
}

/**
 * 查询客户端角色信息详细
 * @param roleId
 * @returns {AxiosPromise}
 */
export function getInfoClientRole(roleId) {
  return axios({
    url: '/clientRole/' + roleId,
    method: 'get'
  })
}

/**
 * 新增客户端角色信息
 * @param data
 * @returns {AxiosPromise}
 */
export function insertClientRole(data) {
  return axios({
    url: '/clientRole',
    method: 'post',
    data: data
  })
}

/**
 * 修改客户端角色信息
 * @param data
 * @returns {AxiosPromise}
 */
export function updateClientRole(data) {
  return axios({
    url: '/clientRole',
    method: 'put',
    data: data
  })
}

/**
 * 删除客户端角色信息
 * @param roleId
 * @returns {AxiosPromise}
 */
export function deleteClientRole(roleId) {
  return axios({
    url: '/clientRole/' + roleId,
    method: 'delete'
  })
}

/**
 * 获取客户端角色下拉数据
 * @returns {*}
 */
export function clientRoleSelect() {
  return axios({
    url: '/clientRole/select',
    method: 'get'
  })
}
